package com.youtills.core.auth.db.dao;


import com.youtills.core.auth.IAuthUser;
import com.youtills.resource.ResourceAttributeValue;

import java.util.Date;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: ravi
 * Date: 8/14/12
 * Time: 10:54 AM
 * To change this template use File | Settings | File Templates.
 */
public class AuthUser implements IAuthUser {

    private Auth auth;
    private Long rid;
    private int userId;
    private String userEmail;
    private boolean tempPassword;
    private String firstName;
    private String lastName;
    private Date passwordChangedDate;
    private Date lastLoginDate;
    private boolean locked;
    private String unlockCode;
    private Date createdDate;

    private static final int RESOURCE_TYPE = 1; //ResourceType.USER.getId();

    public Long getRid() {
        return rid;
    }

    protected void setRid(Long rid) {
        this.rid = rid;
    }

    public Auth getAuth() {
        return auth;
    }

    public void setAuth(Auth auth) {
        this.auth = auth;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public boolean isTempPassword() {
        return tempPassword;
    }

    public void setTempPassword(boolean tempPassword) {
        this.tempPassword = tempPassword;
    }

    public Date getPasswordChangedDate() {
        return passwordChangedDate;
    }

    public void setPasswordChangedDate(Date passwordChangedDate) {
        this.passwordChangedDate = passwordChangedDate;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public boolean isLocked() {
        return locked;
    }

    public void setLocked(boolean locked) {
        this.locked = locked;
    }

    public String getUnlockCode() {
        return unlockCode;
    }

    public void setUnlockCode(String unlockCode) {
        this.unlockCode = unlockCode;
    }

    public Long getResourceId() {
        return (long)getUserId();
    }

    public Long getResourceType() {
        return (long) RESOURCE_TYPE;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    @Override
    public boolean isDirty() {
        return false;
    }

    @Override
    public boolean isImmutable() {
        return false;
    }

    @Override
    public List<ResourceAttributeValue> getAttributeValues() {
        return null;
    }
}
